# -*- coding: utf-8 -*-

from typing import Any
import thulac

class THULACSegmentor:
    def __init__(self, custom_dict_path) -> None:
        self.custom_dict_path = custom_dict_path
        self.thulac = thulac.thulac(seg_only=False, user_dict=custom_dict_path)

    def segment(self, text):
        return self.thulac.cut(text, text=True)